﻿using System;
using System.Windows.Forms;

namespace YJKCodeBase.WinForm.WinFormRemindSuit
{
	internal class ControlTypeMangerFactory : IControlTransformerFactory
	{
		public BaseControlTransFormer GetControlTransFormer(Control inputControl, bool ifIsSpecialValue)
		{
			BaseControlTransFormer result = null;
			if (inputControl is Form)
			{
				result = new LocationControlTransform(inputControl, ifIsSpecialValue);
			}
			else if (inputControl is CheckBox || inputControl is RadioButton)
			{
				result = new CheckedControlTransform(inputControl, ifIsSpecialValue);
			}
			else if (inputControl is TreeView)
			{
				result = new NodesControlTransform(inputControl, ifIsSpecialValue);
			}
			else if (inputControl is ListView || inputControl is CheckedListBox || inputControl is ListBox)
			{
				result = new ItemsControlTransform(inputControl, ifIsSpecialValue);
			}
			else if (inputControl is NumericUpDown)
			{
				result = new ValueControlTransform(inputControl, ifIsSpecialValue);
			}
			else if (inputControl is TextBox || inputControl is ComboBox || inputControl is UserControl || inputControl is Button)
			{
				result = new TextControlTransform(inputControl, ifIsSpecialValue);
			}
			else if (inputControl is PictureBox)
			{
				result = new TagControlTransform(inputControl, ifIsSpecialValue);
			}
			return result;
		}
	}
}
